package 作业;

import java.util.Scanner;

public class Demo06 {
	public static void main(String[] args) {
		Scanner cc=new Scanner(System.in);
		double jg=0;
		double a=0;
		double b=0;
		int xuan =1;
		while(xuan!=0) {
			System.out.println("1、求和\n"
					+ "2、求差\n"
					+ "3、求积\n"
					+ "4、求商\n"
					+ "5、求余\n"
					+ "0、退出程序");
			System.out.println("请根据菜单选择要进行的计算：");
			xuan = cc.nextInt();			
			switch(xuan){
				case 1:
					System.out.println("请分别输入两个数：");
					a=cc.nextDouble();
					b=cc.nextDouble();
					System.out.println(a+"+"+b+"="+(a+b));
					break;
				case 2:
					System.out.println("请分别输入两个数：");
					a=cc.nextDouble();
					b=cc.nextDouble();
					System.out.println(a+"-"+b+"="+(a-b));
					break;
				case 3:
					System.out.println("请分别输入两个数：");
					a=cc.nextDouble();
					b=cc.nextDouble();
					System.out.println(a+"*"+b+"="+(a*b));
					break;
				case 4:
					System.out.println("请分别输入两个数：");
					a=cc.nextDouble();
					b=cc.nextDouble();
					System.out.println(a+"/"+b+"="+(a/b));
					break;
				case 5:
					System.out.println("请分别输入两个数：");
					a=cc.nextDouble();
					b=cc.nextDouble();
					System.out.println(a+"%"+b+"="+(a%b));
					break;
				case 0:			
					System.out.println("退出程序");
					break;
					default:
						System.out.println("选择错误，请重新选择！");
			}
		}
		System.out.println("程序结束！");
	}
}
